package com.cai.quartz.listener.scheduler;

import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
@Slf4j
public class MySchedulerListener implements SchedulerListener {
    @Override
    public void jobScheduled(Trigger trigger) {
        // job 完成部署时候调用
        String name = trigger.getKey().getName();
        log.info("{} 完成部署",name);
    }

    @Override
    public void jobUnscheduled(TriggerKey triggerKey) {
        // 用于卸载jobDetail时候调用
        String name = triggerKey.getName();
        log.info("{} 完成卸载",name);
    }


    @Override
    public void triggerFinalized(Trigger trigger) {
        //触发器被移除
    }

    @Override
    public void triggerPaused(TriggerKey triggerKey) {
        //正在暂停
    }

    @Override
    public void triggersPaused(String s) {
        //触发器组正在暂停
    }

    @Override
    public void triggerResumed(TriggerKey triggerKey) {
        //触发器恢复
    }

    @Override
    public void triggersResumed(String s) {
        //触发器组恢复
    }

    @Override
    public void jobAdded(JobDetail jobDetail) {

    }

    @Override
    public void jobDeleted(JobKey jobKey) {

    }

    @Override
    public void jobPaused(JobKey jobKey) {

    }

    @Override
    public void jobsPaused(String s) {

    }

    @Override
    public void jobResumed(JobKey jobKey) {

    }

    @Override
    public void jobsResumed(String s) {

    }

    @Override
    public void schedulerError(String s, SchedulerException e) {
        //运行期间出现严重错误
    }

    @Override
    public void schedulerInStandbyMode() {
        log.info("调度器被挂起");
    }

    @Override
    public void schedulerStarted() {
        log.info("调度器开启");
    }

    @Override
    public void schedulerStarting() {
        log.info("调度器正在开启");
    }

    @Override
    public void schedulerShutdown() {
        log.info("调度器关闭");
    }

    @Override
    public void schedulerShuttingdown() {
        log.info("调度器正在被关闭");
    }

    @Override
    public void schedulingDataCleared() {
        log.info("调度器数据被清除");
    }
}
